﻿using System;
using System.Collections.Generic;
using System.Data;
using System.IO;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSunny.Admin.Controls
{
    public partial class ViewDetailCategory : System.Web.UI.UserControl
    {
        public string catename;
        public string image;
        public string description;
        public string showcatetop;
        public string showcateleft;
        public int intactivetop;
        public int intactiveleft;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["catid"] != null)
            {
                int cateid = Convert.ToInt32(Request.QueryString["catid"]);
                DataTable dt = DAL.DCollector.DBCollector.Instance.StoredSelectTableWhereID("tbl_Category","Category_ID1", cateid.ToString());
                catename = dt.Rows[0]["Category_Name"].ToString();
                image = dt.Rows[0]["Category_Image"].ToString();
                description = dt.Rows[0]["Category_Description"].ToString();
                showcatetop = dt.Rows[0]["Category_ActiveTop"].ToString();
                showcateleft = dt.Rows[0]["Category_ActiveLeft"].ToString();
                 
            }
        }

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            int cateid = Convert.ToInt32(Request.QueryString["catid"]);
            DAL.DCollector.DBCollector.Instance.StoredDelete("tbl_Category", "Category_ID1", cateid.ToString());
            Response.Redirect("/Admin/Index.aspx?panel=2&sub=1");
        }
    }
}